import request from '@/utils/request'
// 获取新闻详情
export const articlesInfo = id => {
  return request({
    url: `/v1_0/articles/${id}`
  })
}

// 获取评论或评论回复
export const comments = params => {
  return request({
    url: '/v1_0/comments',
    params
  })
}

// 对文章或者评论进行评论
export const commentsPost = data => {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data
  })
}

// 对评论或评论回复点赞
export const commentLikings = target => {
  return request({
    url: '/v1_0/comment/likings',
    method: 'POST',
    data: { target: target }
  })
}

// 取消对评论或评论回复点赞
export const commentLikingsDelete = target => {
  return request({
    url: `/v1_0/comment/likings/${target}`,
    method: 'DELETE'
  })
}
